/obj/item/weapon/stereo
	name = "Stereo"
	icon = 'Music_Player.dmi'
	icon_state = "stereo"
	density = 1
	anchored = 1
	w_class = 4.0
	var/playing = null

/obj/item/weapon/stereo/verb/Play_Song()
	set name = "Play Song"
	set desc = "Play a song!"

	if(playing)
		usr << "There is already music playing!"
		return
	switch(alert("Which song do you wish to play?","Songs","Cancel","Title Music #1","Title Music #2"))
		if("Cancel")
			return
		if("Title Music #1")
			playing = 'title1.ogg'
		if("Title Music #2")
			playing = 'title2.ogg'
	update_icon()
	view(src) << sound(playing,0)
	view(src) << "[usr] plays a sound using the stereo!"

/obj/item/weapon/stereo/verb/Stop_Song()
	set name = "Stop Song"
	set desc = "Stop the currently playing song."

	if(!playing)
		usr << "There is currently no music playing."
		return
	switch(alert("Are you sure you wish to stop the sound: [playing]?","Stop Song?","Stop Song","Cancel"))
		if("Cancel")
			return
		if("Stop Song")
			view(src) << sound(null)
			view(src) << "[usr] stops the music."
			playing = null
			update_icon()

/obj/item/weapon/stereo/update_icon()
	if(playing)
		icon_state = "stereo_playing"
	else
		icon_state = "stereo"
	return

/obj/item/weapon/epod
	name = "ePod"
	icon = 'Music_Player.dmi'
	icon_state = "epod"
	density = 0
	w_class = 1.0
	var/playing = 0
	var/sound = null

/obj/item/weapon/epod/verb/Play_Song(S as sound)
	set name = "Play Song"
	set desc = "Play a song!"

	if(playing == 1)
		usr << "You can't play another song yet!"
		return
	else
		view(src) << sound(S,0)
		view(src) << "[usr] played a sound using the ePod!"
		playing = 1
		sound = S

/obj/item/weapon/epod/verb/Stop_Song()
	set name = "Stop Song"
	set desc = "Stop the currently playing song."

	if(!playing)
		usr << "There is currently no music playing."
		return
	switch(alert("Are you sure you wish to stop the sound: [sound]?","Stop Song?","Stop Song","Cancel"))
		if("Cancel")
			return
		if("Stop Song")
			view(src) << sound(null)
			view(src) << "[usr] stops the music."
			playing = 0